import pandas as pd
from sqlalchemy import create_engine


#   建立与mysql的连接     这里需要禁用ssl安全协议
connect=create_engine('mysql+mysqlconnector://root:123456@192.168.67.193:3307/source?ssl_disabled=True&charset=utf8mb4')
#   low_memory=False
data=pd.read_csv('user_buy_info.csv',low_memory=False)
# data['user_id']=data['user_id'].astype(str)
# data['product_id']=data['product_id'].astype(str)
# data['buy_number']=data['buy_number'].astype(str)


data.to_sql('order_info',con=connect,index=False,if_exists='replace')

